package view.stages;

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.util.Map;

import model.components.ButtonComponent;
import model.stages.StageEnum;
import view.GraphicsMenuBackground;
import view.Screen;

public class StageMainMenu extends AbstractStage{

	Font font = new Font("SansSerif", Font.BOLD, 30);

	Map<StageEnum, ButtonComponent> buttons;
	private static AbstractStage stage = null;

	public StageMainMenu(Screen screen) {
		super(screen);
		super.graphicsElements.add(new GraphicsMenuBackground(screen));
	}

	@Override
	public void paint(Graphics2D g) {

		for(int i=0;i<getGraphicsElements().size();i++){
			getGraphicsElements().get(i).paint(g);
		}

		for(int i=0; i<modelComponents.size(); i++){
			ButtonComponent button = (ButtonComponent) modelComponents.get(i);
			g.setColor(Color.red);
			g.setFont(font);
			// Para vizualizar retangulos
			//g.drawRect(regions.get(key).x, regions.get(key).y, regions.get(key).width, regions.get(key).height);
			if(button.isSelected())
				g.setColor(Color.yellow);
			g.drawString(button.getAction().getName(), button.getRegion().x, button.getRegion().y + 25);
		}
	}

	@Override
	public void update() {
		// TODO Auto-generated method stub
	}
	@Override
	public String getName() {
		return StageEnum.MAIN_MENU.getName();
	}
}